<?php

	$nav = array("Home" => "", "Localization" => "localization/");

	$tpl->assign("dsfm_nav", $nav);

	$table = new Table( array(
		"id" => array(
			"width" => 30,
			"title" => "ID",
			"type" => "order"
		),
		"key" => array(
			"type" => "text",
			"link" => 'edit.php?key=$key'
		),
		"th" => array(
			"type" => "text",
			"link" => 'edit.php?key=$key',
			"title" => "Thai"
		),
		"en" => array(
			"type" => "text",
			"link" => 'edit.php?key=$key',
			"title" => "English"
		),
	));

	$table->add_menu( array(
		"Add New" => array(
			"link" => "form.php",
			"icon" => "add.png"
		)
	));

	$table->add_tool( array(
		"edit" => array(
			"link" => 'edit.php?key=$key',
			"icon" => "edit.png"
		),
		"delete" => array(
			"link" => 'delete.php?key=$key',
			"icon" => "delete.png"
		)
	));

	$th = $dsfm_localization->load("th");
	$en = $dsfm_localization->load("en");

	$match = array();

	$i = 0;
	foreach($th as $key => $value){
		$tmp['id'] = $i;
		$tmp['key'] = $key;
		$tmp['th'] = $value;
		$tmp['en'] = $en[$key];

		array_push($match, $tmp);
		$i++;
	}

	$data = new Data();
	$data->add_data($match);

	$data->search( array("key","th","en"));
	$table->add_data($data->fetch());

	$table->rain_display($tpl, "table");
?>